//
//  XCUnderSingerTableViewCell.m
//  SoundOfNature
//
//  Created by 梁新昌 on 16/3/16.
//  Copyright © 2016年 梁新昌. All rights reserved.
//

#import "XCUnderSingerTableViewCell.h"

@implementation XCUnderSingerTableViewCell
- (void)dealloc {
    [_moreButton release];
    [_nameLable release];
    [_numberLable release];
    [_albumNameLable release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.moreButton = [UIButton buttonWithType:UIButtonTypeSystem];
        self.nameLable = [[XCBaseLable alloc] initWithFrame:CGRectZero];
        self.nameLable.userInteractionEnabled = YES;
        
        self.numberLable = [[XCBaseLable alloc] initWithFrame:CGRectZero];
        self.numberLable.userInteractionEnabled = YES;
        
        self.albumNameLable = [[XCBaseLable alloc] initWithFrame:CGRectZero];
        self.albumNameLable.userInteractionEnabled = YES;
        
        [self.contentView addSubview:self.moreButton];
        [self.contentView addSubview:self.nameLable];
        [self.contentView addSubview:self.albumNameLable];
        [self.contentView addSubview:self.numberLable];
        
        [self.numberLable release];
        [self.albumNameLable release];
        [self.nameLable release];
        
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.numberLable.frame = CGRectMake(10, 10, self.bounds.size.width / 5, self.bounds.size.width / 5);
//    self.numberLable.font = [UIFont systemFontOfSize:35];
//    self.numberLable.textAlignment = NSTextAlignmentCenter;
    self.nameLable.frame = CGRectMake(self.numberLable.frame.size.width + self.numberLable.frame.origin.x + 20, self.bounds.size.height / 2 - 30, self.bounds.size.width / 2, 21);
    self.nameLable.textColor = [UIColor colorWithWhite:0.800 alpha:0.8];
    self.albumNameLable.frame = CGRectMake(self.numberLable.frame.size.width + self.numberLable.frame.origin.x + 20, self.nameLable.frame.size.height + self.nameLable.frame.origin.y + 10, self.bounds.size.width / 2, 21);
    
    self.albumNameLable.textColor = [UIColor colorWithWhite:0.800 alpha:0.8];

//    self.albumNameLable.font = [UIFont systemFontOfSize:15];
    
    
    
}
- (void)setUnderSingerModel:(XCUnderSingerDataModel *)underSingerModel {
    if (_underSingerModel != underSingerModel) {
        [_underSingerModel release];
        _underSingerModel = [underSingerModel retain];
    }
    
    
        self.nameLable.text = underSingerModel.name;
        self.albumNameLable.text = underSingerModel.albumName;
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
